package 设计模式.适配器模式.对象适配器模式;

public class Phone {

    private double  battery;
    private final int capacity=100;

    public void charge(Voltage5vInterface v5){
        while (battery<=capacity){
            battery+= v5.output();
            try {
                Thread.sleep(1000);
                System.out.println("当前电量:"+battery+"%");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
